package com.ch.light.mybatis;

/**
 * DriverType
 * Created by zhimin on 2017/5/14.
 */
public enum DriverType {
    MYSQL("MySQL", "MYSQL", "com.mysql.jdbc.Driver");

    private final String code;
    private final String name;
    private final String clazz;

    DriverType(String code, String name, String clazz) {
        this.code = code;
        this.name = name;
        this.clazz = clazz;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getClazz() {
        return clazz;
    }


    public static DriverType fromCode(String code) {
        DriverType type = DriverType.MYSQL;
        switch (code) {
            case "MySQL":
                type = DriverType.MYSQL;
                break;
        }
        return type;
    }

}
